package com.atguigu.gulimall.ware.service;

import com.atguigu.common.to.es.SkuHasStock;
import com.atguigu.common.to.mq.StockItemTo;
import com.atguigu.gulimall.ware.entity.PurchaseDetailEntity;
import com.atguigu.gulimall.ware.vo.WareSkuLockVo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.atguigu.common.utils.PageUtils;
import com.atguigu.gulimall.ware.entity.WareSkuEntity;

import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * 商品库存
 *
 * @author yangheng
 * @email sunlightcs@gmail.com
 * @date 2023-03-25 10:57:49
 */
public interface WareSkuService extends IService<WareSkuEntity> {

    PageUtils queryPage(Map<String, Object> params);

    void addStock(PurchaseDetailEntity itemId);

    List<SkuHasStock> getSkuHasStock(List<Long> skuIds);

    boolean saveOrderToLockStock(WareSkuLockVo wareSkuLockVo);

    void handleReleaseStock(StockItemTo stockItemTo) throws RuntimeException;

    void handleReleaseAfterOrder(String orderSn);
}

